Skip to content

Move the celebratory modal confetti into the website - #13175

Open
dem4ron wants to merge 1 commit into
mainfrom
vendor-active-background-confetti
Open

dem4ron wants to merge 1 commit into
mainfrom
vendor-active-background-confetti

Conversation

@dem4ron

@dem4ron dem4ron commented Nov 26, 2026

Copy link
Copy Markdown
Member

Why

The confetti behind celebratory modals comes from @exercism/active-background (exercism/react-active-background). We don't want to keep maintaining that package, and the website is its only user.

We tried canvas-confetti, which the bootcamp already uses, but it can't draw the curling ribbon streamers and the effect looked clearly different. So this copies the code in instead. It's plain canvas maths with no dependencies and hasn't needed a real change in years.

What changes

  • app/javascript/components/modals/confetti/: the confetti classes (Confetti, ConfettiPaper, ConfettiRibbon, EulerMass, Vector), copied almost unchanged from version 0.6.2 (MIT, Exercism). The only edits are imports and dropping the package's plugin interfaces.
  • ConfettiBackground.tsx replaces the package's ActiveBackground wrapper. It fills the modal overlay, uses the same options Modal.tsx passed before, and restarts on resize.
  • It keeps the old canvas sizing, which ignores devicePixelRatio. Fixing that would make the confetti several times denser on retina screens.
  • New: it draws nothing when the user prefers reduced motion.
  • Removes the @exercism/active-background dependency, and common/Wrapper.tsx, which only Modal.tsx used.

Where to check it

Every modal that passes celebratory:

Modal Page How to open it
Track trophy /tracks/:slug On a joined track, click an earned trophy in the Trophy cabinet
Mentor testimonial /mentoring/testimonials As a mentor, click or reveal a testimonial
Profile testimonial /profiles/:handle/testimonials Click any testimonial
Impact testimonial /about/impact, /about/testimonials Click any testimonial

Testing

  • Type-check is clean for the changed files, and the mentoring testimonials JS tests pass.
  • Not yet checked in the running app.

Once this is merged, exercism/react-active-background can be archived.

🤖 Generated with Claude Code

The confetti behind celebratory modals came from
@exercism/active-background, a separate package we no longer want to
maintain. Its confetti code now lives in
app/javascript/components/modals/confetti/, copied almost unchanged
(MIT, Exercism), so the effect looks and moves exactly as before.

ConfettiBackground replaces the package's ActiveBackground wrapper. It
keeps the old canvas sizing, which ignores devicePixelRatio, because
changing it would make the confetti several times denser on retina
screens. It now draws nothing when the user prefers reduced motion.

Also removes common/Wrapper.tsx, which only Modal.tsx used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dem4ron
dem4ron requested a review from iHiD as a code owner November 26, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant